package com.itheima.health.dao;

import com.itheima.health.pojo.OrderSetting;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * @program: health_parent
 * @description:
 * @author: HuChunping
 * @create: 2021-01-13 17:55
 **/

public interface OrdersettingDao {
    /**
    * @Description: 通过日期查找预约
    * @Param: [orderDate]
    * @return: com.itheima.health.pojo.OrderSetting
    * @Author: HuChunping
    * @Date: 2021/1/13-19:26
    */
    OrderSetting findByOrderDate(Date orderDate);

    /**
    * @Description: 当该日期没有预约直接创建预约
    * @Param: [orderSetting]
    * @return: void
    * @Author: HuChunping
    * @Date: 2021/1/13-19:31
    */
    void add(OrderSetting orderSetting);

    /**
    * @Description: 日期有预约，但是修改最大预约人数大于已预约人数
    * @Param: [osInDB]
    * @return: void
    * @Author: HuChunping
    * @Date: 2021/1/13-19:36
    */
    void update(OrderSetting osInDB);

    /**
    * @Description: 通过年月查询当月数据
    * @Param: [month]
    * @return: java.util.List<java.util.Map<java.lang.String,java.lang.Integer>>
    * @Author: HuChunping
    * @Date: 2021/1/14-19:58
    */
    List<Map<String, Integer>> getOrderSettingByMonth(String month);

    /**
     * 更新已预约人数
     * @Author: HuChunping
     * @Date: 2021/1/16 23:10
     * @param orderSetting: 订单设置
     * @return: int 受影响的记录数
     **/
    int editReservationsByOrderDate(OrderSetting orderSetting);
}
